import org.apache.spark.{SparkConf, SparkContext}

object BroadCastValueTest {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setAppName("BroadCastTest").setMaster("local")
    conf.set("spark.testing.memory", "2147480000")
    val sc = new SparkContext(conf)
    val bcv = sc.broadcast(3)
    val rdd = sc.parallelize(Array(1,2,3,4,5))
    rdd.map(x => x+bcv.value).collect().foreach(println)
  }
}
